﻿@model Xms.Web.Models.UploadSettingModel
<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">
            <a data-toggle="collapse"
               href="#collapseTwo">
                <strong>@app.PrivilegeTree?.LastOrDefault().DisplayName</strong>
            </a>
        </h3>
    </div>
    <div class="panel-body">
        <form id="editform" class="form-horizontal" data-jsonajax="true" data-istip="true" action="/@(app.OrganizationUniqueName)/api/settings/upload" method="post">
            <div class="form-group col-sm-12">
                <label class="col-sm-2 control-label" for="FileExts">文件类型</label>
                <div class="col-sm-10">
                    @Html.TextBoxFor(x => x.FileExts, new { @class = "form-control required" })
                </div>
            </div>
            <div class="form-group col-sm-12">
                <label class="col-sm-2 control-label" for="MaxSize">最大(kb)</label>
                <div class="col-sm-10">
                    @Html.TextBoxFor(x => x.MaxSize, new { @class = "form-control", @data_type = "int" })
                </div>
            </div>
            <div class="form-group col-sm-12">
                <label class="col-sm-2 control-label" for="MaxSize">文件命名</label>
                <div class="col-sm-10">
                    @Html.TextBoxFor(x => x.FormatName, new { @class = "form-control" })
                </div>
            </div>
            <div class="form-group col-sm-12 text-center" id="form-buttons">
                <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-saved"></span> @app.T["save"]</button>
                <button type="reset" class="btn btn-default"><span class="glyphicon glyphicon-refresh"></span> @app.T["reset"]</button>
            </div>
        </form>
    </div>
</div>

@section Scripts {
    <script src="/content/js/jquery.form.js?v=@app.PlatformSettings.VersionNumber"></script>
    <script src="/content/js/jquery-validate/jquery.validate.min.js?v=@app.PlatformSettings.VersionNumber"></script>
    <script src="/content/js/jquery-validate/localization/messages_zh.min.js?v=@app.PlatformSettings.VersionNumber"></script>
    <script>
        $(function () {
            //表单验证
            var $form = $("#editform");
            Xms.Web.Form($form, function (response) {
                console.log(response);
                //Xms.Web.Toast(response.Content, response.IsSuccess);
            });
        });
    </script>
}